package com.atguigu.gmall.pay.rpc;

import com.alipay.api.AlipayApiException;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.pay.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/9/16 3:25
 */
@RestController
@RequestMapping("/rpc/inner/alipay")
public class RpcAlipayController {
    @Autowired
    PayService payService;
    @GetMapping("/checkOrderStatus/{outTradeNo}")
    public Result<String> checkOrderStatus(@PathVariable("outTradeNo") String outTradeNo) throws AlipayApiException {
        // 调用支付宝接口，查询订单状态
        String status=payService.checkOrderStatus(outTradeNo);
        return Result.ok(status);
    }
}
